import requests


def main():
    url = "https://qianfan.baidubce.com/v2/app/conversation/file/upload"

    payload = {
        'app_id': 'ae45d5b1-6c61-4c74-843e-140b3508bab6',
        'conversation_id': '5ca019c9-4c13-4276-859b-39ec6ac8e719'
    }
    files = [
        ('file', ('R-C.jpg', open('C:\\Users\\zh415st026\\Desktop\\R-C.jpg', 'rb'), 'image/jpeg'))
    ]
    headers = {
        'X-Appbuilder-Authorization': 'Bearer bce-v3/ALTAK-wZggh5hPuC7b9OVBjqJgS/fdf601529793239ade14b1f976bc11fcf2e99194'
    }

    response = requests.request("POST", url, headers=headers, data=payload, files=files)

    print(response.text)


if __name__ == '__main__':
    main()
